namespace PickGold.Charting
{
	using System;
	using System.ComponentModel;
	using System.Security.Permissions;
	using System.Web;

	[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
	public class ChartArea3DStyle
	{
		private ChartArea _chartArea;
		private bool _enable3D;
		private int _inclination;
		private bool _isClustered;
		private bool _isRightAngleAxes;
		private LightStyle _lightStyle;
		private int _perspective;
		private int _pointDepth;
		private int _pointGapDepth;
		private int _rotation;
		private int _wallWidth;

		public ChartArea3DStyle()
		{
			this._isRightAngleAxes = true;
			this._lightStyle = LightStyle.Simplistic;
			this._inclination = 30;
			this._rotation = 30;
			this._wallWidth = 7;
			this._pointDepth = 100;
			this._pointGapDepth = 100;
		}

		public ChartArea3DStyle(ChartArea chartArea)
		{
			this._isRightAngleAxes = true;
			this._lightStyle = LightStyle.Simplistic;
			this._inclination = 30;
			this._rotation = 30;
			this._wallWidth = 7;
			this._pointDepth = 100;
			this._pointGapDepth = 100;
			this._chartArea = chartArea;
		}

		internal void Initialize(ChartArea chartArea)
		{
			this._chartArea = chartArea;
		}

		[SRDescription("DescriptionAttributeChartArea3DStyle_Enable3D"), Bindable(true), DefaultValue(false), SRCategory("CategoryAttribute3D"), ParenthesizePropertyName(true)]
		public bool Enable3D
		{
			get
			{
				return this._enable3D;
			}
			set
			{
				if (this._enable3D != value)
				{
					this._enable3D = value;
					if (this._chartArea != null)
					{
						this._chartArea.Invalidate();
					}
				}
			}
		}

		[SRDescription("DescriptionAttributeChartArea3DStyle_Inclination"), SRCategory("CategoryAttribute3D"), RefreshProperties(RefreshProperties.All), Bindable(true), DefaultValue(30)]
		public int Inclination
		{
			get
			{
				return this._inclination;
			}
			set
			{
				if ((value < -90) || (value > 90))
				{
					throw new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DInclinationInvalid);
				}
				this._inclination = value;
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}

		[DefaultValue(false), SRDescription("DescriptionAttributeChartArea3DStyle_Clustered"), Bindable(true), SRCategory("CategoryAttribute3D")]
		public bool IsClustered
		{
			get
			{
				return this._isClustered;
			}
			set
			{
				this._isClustered = value;
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}

		[SRCategory("CategoryAttribute3D"), Bindable(true), DefaultValue(true), SRDescription("DescriptionAttributeChartArea3DStyle_RightAngleAxes"), RefreshProperties(RefreshProperties.All)]
		public bool IsRightAngleAxes
		{
			get
			{
				return this._isRightAngleAxes;
			}
			set
			{
				this._isRightAngleAxes = value;
				if (this._isRightAngleAxes)
				{
					this._perspective = 0;
				}
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}

		[SRCategory("CategoryAttribute3D"), DefaultValue(typeof(LightStyle), "Simplistic"), SRDescription("DescriptionAttributeChartArea3DStyle_Light"), Bindable(true)]
		public LightStyle LightStyle
		{
			get
			{
				return this._lightStyle;
			}
			set
			{
				this._lightStyle = value;
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}

		[DefaultValue(0), Bindable(true), SRCategory("CategoryAttribute3D"), SRDescription("DescriptionAttributeChartArea3DStyle_Perspective"), RefreshProperties(RefreshProperties.All)]
		public int Perspective
		{
			get
			{
				return this._perspective;
			}
			set
			{
				if ((value < 0) || (value > 100))
				{
					throw new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DPerspectiveInvalid);
				}
				this._perspective = value;
				if (this._perspective != 0)
				{
					this._isRightAngleAxes = false;
				}
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}

		[SRDescription("DescriptionAttributeChartArea3DStyle_PointDepth"), Bindable(true), RefreshProperties(RefreshProperties.All), SRCategory("CategoryAttribute3D"), DefaultValue(100)]
		public int PointDepth
		{
			get
			{
				return this._pointDepth;
			}
			set
			{
				if ((value < 0) || (value > 0x3e8))
				{
					throw new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DPointsDepthInvalid);
				}
				this._pointDepth = value;
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}

		[RefreshProperties(RefreshProperties.All), SRCategory("CategoryAttribute3D"), DefaultValue(100), Bindable(true), SRDescription("DescriptionAttributeChartArea3DStyle_PointGapDepth")]
		public int PointGapDepth
		{
			get
			{
				return this._pointGapDepth;
			}
			set
			{
				if ((value < 0) || (value > 0x3e8))
				{
					throw new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DPointsGapInvalid);
				}
				this._pointGapDepth = value;
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}

		[DefaultValue(30), SRCategory("CategoryAttribute3D"), Bindable(true), RefreshProperties(RefreshProperties.All), SRDescription("DescriptionAttributeChartArea3DStyle_Rotation")]
		public int Rotation
		{
			get
			{
				return this._rotation;
			}
			set
			{
				if ((value < -180) || (value > 180))
				{
					throw new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DRotationInvalid);
				}
				this._rotation = value;
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}

		[RefreshProperties(RefreshProperties.All), SRCategory("CategoryAttribute3D"), Bindable(true), DefaultValue(7), SRDescription("DescriptionAttributeChartArea3DStyle_WallWidth")]
		public int WallWidth
		{
			get
			{
				return this._wallWidth;
			}
			set
			{
				if ((value < 0) || (value > 30))
				{
					throw new ArgumentOutOfRangeException("value", SR.ExceptionChartArea3DWallWidthInvalid);
				}
				this._wallWidth = value;
				if (this._chartArea != null)
				{
					this._chartArea.Invalidate();
				}
			}
		}
	}
}

